<div class="question">
    <div class="item lz mt20">
        <div class="user-cover"><img src="<?= $question->user_cover ?>@!90" alt="用户头像"/></div>
        <div class="info">
            <div class="user-name">
            <p>
                <span>
                <?php if($question -> user_gender == 1): ?>
                    <img src="/assets/frontend/img/share/icon-man.png" alt="男">
                <?php elseif ($question -> user_gender == 2): ?>
                    <img src="/assets/frontend/img/share/icon-woman.png">
                <?php else :?>
                                                                     未知
                <?php endif ?>

                </span>
                <?= $question->user_nickname ?>
            </p>
            <div class="time"><?= $question -> addtime?></div>
            </div>
        </div>


        <div class="content">
            <p class="description"><?= $question->question_content ?></p>

                <?php if(count($question -> question_tag) > 0): ?>
            <div class="tags">
                    <?php foreach ($question -> question_tag as $tag): ?>
                        <span><?=$tag ?></span>
                    <?php endforeach;?>
                <div class="clear"></div>
            </div>
                <?php endif; ?>
                



            <?php if(count($question->question_pics) > 0): ?>
            <ul class="pics">
                <?php $pi=0; foreach($question->question_pics as $pic): ?>
                <?php $class = $pi % 4 == 0 ? 'ml0' : ($pi % 4 == 3 ? 'mr0' : '') ?>
                <li><img class="<?= $class ?>" src="<?= $pic ?>@!120" /></li>
                <?php $pi++ ?>
                <?php endforeach ?>
            </ul>
            <?php endif ?>
            <div class="clear"></div>
            <div class="bottom">
                <div class="left">
                    <img src="/assets/frontend/img/share/icon-comment.png" alt="评论">
                    <span><?=$question->answer_num ?></span>
                    <img src="/assets/frontend/img/share/icon-read.png" alt="阅读量">
                    <span><?=$question->question_browsers ?></span>
                </div>
                <div class="collection">
                    <img src="/assets/frontend/img/share/icon-3dot.png" />
                </div>
                <div class="clear"></div>
            </div>

        </div>

    </div>

    <?php if(!empty($covers)):?>
    <div class="readTitle" style="border-top: 1px solid #f6f3ec;">
        <span style="vertical-align: -webkit-baseline-middle;">~</span>美人儿已阅<span style="vertical-align: -webkit-baseline-middle;">~</span>
    </div>
    <div class="haveRead">
        <?php foreach ($covers as $cover):?>
            <img src="<?=$cover['user_cover'] ?>">
        <?php endforeach;?>
    </div>
    <?php endif;?>
</div>

<!--专家回复-->
<?php if(!empty($expert)): ?>
<div class="question expert">
    <div class="mt20 listItem line">
        <span><img src="/assets/frontend/img/share/icon-expert.png"></span>
        专家回复
    </div>
    <?php foreach ($expert as $exp):?>
    <div class="item line">
        <div class="user-cover"><img src="<?=$exp['user_cover'] ?>@!90"></div>
        <div class="info">
            <div class="user-name">
                <p><span><?=$exp['user_nickname'] ?></span><i><?=$exp['attr_value_json']['experttitle'] ?></i></p>
                <div class="good-at"><label>擅长领域：</label><em><?=$exp['attr_value_json']['field'] ?></em></div>
            </div>
        </div>

        <div class="content">
            <p class="description"><?=$exp['answer_content'] ?></p>
        </div>
        <ul class="actions">
            <li><?=$exp['answer_addtime']?></li>
            <li>仅楼主可回复</li>
            <li><img class="actions-links" src="/assets/frontend/img/share/links.png"><?=$exp['support_count']?></li>
        </ul>
        <?php if($exp['reply']): ?>
        <div class="reply">
            <?php foreach($exp['reply'] as $r): ?>
            <?php if($r['user_id'] == $exp['user_id']){?>
            <ul class="reply-list">
                <li class="clearfix title">
                    <span class="name pull-left"><?=$exp['user_nickname']?></span>
                    <i class="time pull-right"><?=$r['add_time']?></i>
                </li>
                <li class="con">
                    回复<em class="replyTo"><?= $question->user_nickname ?>:</em><?=$r['content']?>
                </li>
            </ul>
            <?php }else{?>
            <ul class="reply-list">
                <li class="clearfix title">
                    <span class="name pull-left"><?=$r['user_nickname']?></span>
                    <i class="time pull-right"><?=$r['add_time']?></i>
                </li>
                <li class="con">
                    回复<em class="replyTo"><?=$exp['user_nickname']?>:</em><?=$r['content']?>
                </li>
            </ul><?php }?>
            <?php endforeach; ?>
        </div>
        <?php endif; ?>
    </div>
    <?php endforeach;?>
</div>
<?php endif;?>
<!--网友回复-->
<?php if (!empty($answer)): ?>
<div class="question">
    <div class="mt20 listItem line">网友回复</div>
    <?php foreach($answer as $a): ?>
    <div class="item line">
        <div class="user-cover"><img src="<?= $a['user_cover'] ?>@!90" /></div>
        <div class="info">
            <div class="user-name">
                <p>
                    <span>
                        <?php if($a['user_gender'] == 1): ?>
                            <img src="/assets/frontend/img/share/icon-man.png" alt="男">
                        <?php elseif ($a['user_gender'] == 2): ?>
                            <img src="/assets/frontend/img/share/icon-woman.png">
                        <?php else :?>
                                                                                    未知
                        <?php endif ?>
                    </span>
                    <?= $a['user_nickname'] ?>
                </p>
                <div class="time"><?= $a['answer_addtime'] ?></div>
            </div>
        </div>

        <div class="content noPadding">
            <p class="description"><?= $a['answer_content'] ?></p>
            <?php if($a['original_content']): ?>
            <div class="reply wy">
                <span><?=$a['original_content']?></span>
            </div>
            <?php endif;?>
        </div>
        <?php if(count($a['answer_pics']) > 0): ?>
        <ul class="pics">
            <?php $pi=0; foreach($a['answer_pics'] as $pic): ?>
            <?php $class = $pi % 4 == 0 ? 'ml0' : ($pi % 4 == 3 ? 'mr0' : '') ?>
            <li><img class="<?= $class ?>" src="<?= $pic ?>@!120" /></li>
            <?php $pi++ ?>
            <?php endforeach ?>
        </ul>
        <?php endif ?>
        <div class="actions-wy">
            <img class="actions-links" src="/assets/frontend/img/share/links.png"><?=$exp['support_count']?>
        </div>
    </div>
    <?php endforeach ?>
</div>
<?php endif;?>